<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;
use think\model\concern\SoftDelete;
use think\model\relation\HasOne;

/**
 * @mixin Model
 */
class NoticeUserLog extends Model
{
    use SoftDelete;
    protected $table = 'think_notice_user_log';
    protected $pk = 'id';
    protected $autoWriteTimestamp = true;
    protected $createTime = 'create_time';//创建时间
    protected $updateTime = 'update_time';//更新时间
    protected string $deleteTime = 'delete_time';//删除时间

    /**
     * 已读状态 0：未读
     */
    public const IS_READ_DEFAULT = 0;

    /**
     * 已读状态 1：已读
     */
    public const IS_READ_YES = 1;

    public function notice(): HasOne
    {
        return $this->hasOne(Notice::class, 'id', 'notice_id');
    }
}
